<div class="main layui-clear">
	<h2 class="page-title">发表问题</h2>

	<div class="layui-form layui-form-pane">
		<form action="/topic/update/${topic.id!''}.html" method="post">
			<input type="hidden" name="id" value="${topic.id!''}">
			<div class="layui-form-item">
				<label for="L_title" class="layui-form-label">标题</label>
				<div class="layui-input-block">
					<input type="text" id="L_title" name="title" required
						lay-verify="required" autocomplete="off" class="layui-input"
						value="${topic.title!''}">
				</div>
			</div>
			<div class="layui-form-item layui-form-text">
				<div class="layui-input-block">
					<textarea id="content" name="content" required
						lay-verify="required" placeholder="请输入内容"
						class="layui-textarea fly-editor" style="height: 260px;">${topic.content!''}</textarea>
				</div>
				<label for="content" class="layui-form-label" style="top: -2px;">描述</label>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">所在类别</label>
					<div class="layui-input-block">
						<select lay-verify="required" name="cate">
							<option></option>
							<option value="default" selected="selected">默认分类</option>
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">悬赏</label>
					<div class="layui-input-block">
						<select name="price">
							<option value="5"<#if topic.price == 5>selected</#if>>5</option>
							<option value="20"<#if topic.price ==
								20>selected</#if>>20</option>
							<option value="50"<#if topic.price ==
								50>selected</#if>>50</option>
							<option value="100"<#if topic.price ==
								100>selected</#if>>100</option>
						</select>
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<button class="layui-btn" lay-filter="*" lay-submit
					onclick="if(layedit){layedit.sync(index);}">立即发布</button>
			</div>
		</form>
	</div>
</div>
</div>
<script>
var layedit  , index;
layui.use(['form' , 'layedit'], function(){
  var form = layui.form() ;
  layedit = layui.layedit;
  index = layedit.build('content'); //建立编辑器
});
</script>